/*
 * @lc app=leetcode.cn id=551 lang=cpp
 *
 * [551] 学生出勤记录 I
 */

// @lc code=start
class Solution {
public:
    bool checkRecord(string s) {
        //直接模拟
        int a = 0, l = 0;
        for(auto x : s){
            if(x == 'A') {a++; l = 0;}
            else if (x == 'L') l++;
            else {l = 0;}
            if(a > 1 || l > 2) return false; 
        }
        return true;
    }
};
// @lc code=end

